#! /usr/bin/python python3

# 打印三角形

def sanj():

    for a in range(1, 6):
        for b in range(6-a,0,-1):
            print('*', end=' ')
        print()


# 打印梯形

#for a in range(3, 8):
    #print((7 - a) * ' ', '* ' * a)

def ti():
    for a in range(1, 7):
        print(' ' * (6 - a), '*' * (2 * a + 1))


# 打印菱形

def ling():
    for a in range(1,6):
        print(' ' * abs(3 - a), '*' * (5 - 2 * abs(3 - a)))


# 打印乘法表

def jiu():
    for a in range(1, 10):
        for b in range(1, a + 1):
            print(b, '*', a, '=', a * b, end='  ')
        print()


while True:
    print('目录')
    print('1.打印三角形')
    print('2.打印梯形')
    print('3.打印菱形')
    print('4.打印九九乘法表')
    print('0.退出')
    print('--------------------------------------------------------')

    s=int(input('请输入选项:'))
    if s == 1:
        sanj()
    elif s == 2:
        ti()
    elif s == 3:
        ling()
    elif s == 4:
        jiu()
    elif s == 0:
        break
    print('-------------------------------------------------------')















